package server.scripting.npc;

/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 *
 * NPCConversationManager.java
 *
 * Steven Louie Apr. 8, 2012
 *
 */
import client.ActinoClient;
import client.ActinoPlayer;
import server.ActinoServer;
import server.net.NPCInteraction;
import server.scripting.AbstractPlayerInteraction;

public class NPCConversationManager extends AbstractPlayerInteraction {

    private ActinoClient client;
    private int npc;
    private String fileName = null;
    private ActinoPlayer player;

    public NPCConversationManager(ActinoClient client, int npc, ActinoPlayer player, String fileName) {
        super(client);
        this.client = client;
        this.npc = npc;
        this.player = player;
        this.fileName = fileName;
    }

    public int getNpc() {
        return npc;
    }

    public String getName() {
        return getPlayer().getName();
    }

    public void sendNext(String text) {
        NPCInteraction npcinteract = new NPCInteraction();
        npcinteract.npc = npc;
        npcinteract.text = text;
        npcinteract.type = "next";
        ActinoServer.getInstance().getServer().sendToTCP(client.getConn().getID(), npcinteract);
    }

    public void setYesNo(String text) {
    }

    public void sendAcceptDecline(String text) {
    }
    
    public void dispose() {
        NPCScriptManager.getInstance().dispose(this);
    }
}
